<#assign ctx=request.contextPath />
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/static/layuiadmin/layui/css/layui.css" media="all">

    <link rel="stylesheet" href="${ctx}/static/layuiadmin/style/admin.css" media="all">
</head>
<body>
<form class="layui-form" action="" id="school">
    <div class="layui-form" lay-filter="layuiadmin-form-school" id="layuiadmin-form-school" style="padding: 20px 0 0 0;">

        <input type="hidden" name="id" id="id"  placeholder="请输入国家名" autocomplete="off" class="layui-input">
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block" style="width:800px">
                <input type="text" name="decribe" id="decribe" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">值</label>
            <div class="layui-input-block" style="width:800px">
                <input type="text" name="value" id="value" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">关键字</label>
            <div class="layui-input-block" style="width:800px">
                <input name="key" id="key" placeholder="请输入内容" class="layui-textarea"></input>
            </div>
        </div>
        <!--<div class="layui-form-item">
            <label class="layui-form-label">金额</label>
            <div class="layui-input-block" style="width:800px">
                <input type="number" name="noticeAmount" id="noticeAmount" placeholder="请输入内容" class="layui-textarea"></input>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">创建时间</label>
            <div class="layui-input-block" style="width:800px">
                <input type="time" name="createTime" id="createTime" placeholder="请输入内容" class="layui-textarea"></input>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">接收时间</label>
            <div class="layui-input-block" style="width:800px">
                <input type="time" name="acceptTime" id="acceptTime" placeholder="请输入内容" class="layui-textarea"></input>
            </div>
        </div>-->



        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block" style="width:800px">
                <select id="status" name="status">
                    <option checked value="1">启用</option>
                    <option  value="0">不启用</option>
                </select>
            </div>
        </div>




        <!--<div class="layui-form-item">
            <label class="layui-form-label">照片</label>
            <button type="button" class="layui-btn" id="test3">图片上传</button>
            <div class="layui-input-block">
                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;max-width: 300px;">
                    预览图：
                    <div class="layui-upload-list" id="demo3"></div>
                    <img class="layui-upload-img" id="demo4" style="width:150px;height:150px">
                    <input type="hidden" id="imgUrl" name="imgUrl" value="">
                    &lt;!&ndash;img_index&ndash;&gt;
                </blockquote>
            </div>
        </div>-->
        <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">省</label>-->
        <!--<div class="layui-input-inline">-->
        <!--<input type="text" name="province" id="province" lay-verify="required" placeholder="请输入省" autocomplete="off" class="layui-input">-->
        <!--</div>-->
        <!--</div>-->
        <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">市</label>-->
        <!--<div class="layui-input-inline">-->
        <!--<input type="text" name="city" id="city" lay-verify="required"  placeholder="请输入市" autocomplete="off" class="layui-input">-->
        <!--</div>-->
        <!--</div>-->
        <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">省份</label>-->
        <!--<div class="layui-input-inline" >-->
        <!--<select id="provinceId" name="provinceId" lay-filter="provinceId"  lay-verify="required" >-->
        <!--<option  value=""></option>-->
        <!--</select>-->
        <!--</div>-->
        <!--</div>-->
        <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">市</label>-->
        <!--<div class="layui-input-inline" >-->
        <!--<select id="cityId" name="cityId" lay-verify="required" lay-filter="cityId" >-->
        <!--<option  value=""></option>-->
        <!--</select>-->
        <!--</div>-->
        <!--</div>-->

        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="LAY-professor-front-submit" id="LAY-professor-front-submit" value="确认">
        </div>
    </div>
</form>
<script src="${ctx}/static/layuiadmin/layui/layui.js"></script>
<script>
    var ctx = "${ctx}";
    layui.config({
        base: ctx + '/static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'upload','layedit'], function(){
        var $ = layui.$
            ,form = layui.form
            ,layedit = layui.layedit
            ,upload = layui.upload;
        var infoDetailEdit = layedit.build('condition'); //建立编辑器;
        form.verify({
            condition: function(value) {
                return layedit.sync(infoDetailEdit);
            }
        });

        upload.render({
            elem: '#test3'
            // ,url: ctx +'/file/uploadFile'
            ,url: ctx +'/file/uploadFile'

            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#demo4').attr('src', result); //图片链接（base64）
                    //  $('#demo2').append('<img src="'+ result +'" alt="'+ file.name +'" class="layui-upload-img" style="width:150px;height:150px">')
                });
            }
            ,done: function(res){
                //上传完毕
                var url=res.files[0].fileUrl;
//           console.log(res);
                $('#imgUrl').val(url);
            }
        });





    })
</script>
</body>
</html>